package com.aos.erp.manager.remote.model.vo;

import com.aos.erp.common.utils.DateUtils;
import com.aos.erp.common.utils.StringUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
@ApiModel("导出待审核学员查询条件")
public class ExportStudentConditionVo implements Serializable {

    @ApiModelProperty(hidden = true, value = "每页查询数量")
    private int pageSize = 100;
    @ApiModelProperty(hidden = true, value = "当前页码")
    private int pageIndex = 1;
    @ApiModelProperty(hidden = true, value = "驾校ID")
    private long driverSchoolId=0;
    @ApiModelProperty(hidden = true, value = "操作城市编号")
    private String cityCode="";
    @ApiModelProperty(hidden = true, value = "时间类型")
    private int timeType=0;
    @ApiModelProperty(hidden = true, value = "开始时间")
    private String fromTime="";
    @ApiModelProperty(hidden = true, value = "结束时间")
    private String toTime="";

    @ApiModelProperty(hidden = true, value = "学员姓名或证件号码")
    private String searchKey="";

    @ApiModelProperty(hidden = true, value = "学员ID列表")
    private List<Long> studentId = new ArrayList<>();

    public Date getFromDate() {
        if(StringUtils.isNotEmpty(fromTime)) {
            return DateUtils.toDate(fromTime);
        } else {
            return null;
        }
    }

    public Date getToDate() {
        if(StringUtils.isNotEmpty(toTime)) {
            return DateUtils.toDate(toTime);
        } else {
            return null;
        }
    }
}
